#ifndef __LEDC_HAL_H__
#define __LEDC_HAL_H__

#include "esp_err.h"

#define LEDC_TIMER LEDC_TIMER_0
#define LEDC_MODE LEDC_LOW_SPEED_MODE
#define LEDC_CHANNEL LEDC_CHANNEL_0     /* Ledc channel */
#define LEDC_DUTY_RES LEDC_TIMER_13_BIT /* Set duty resolution to 13 bits*/
#define LEDC_DUTY (4096)                /* Set duty to 50%. (2 ** 13) * 50% = 4096 --> ( 2^13=8192 )*/
#define LEDC_FREQUENCY (8000)           /* Frequency in Hertz. Set frequency at 8 kHz*/

#ifdef __cplusplus
extern "C"
{
#endif

    esp_err_t ledc_init(uint8_t gpio);                  /* ledc init */
    esp_err_t ledc_set_brightness(uint32_t brightness); /* ledc set brightness */
    void ledc_app_test(void);                           /* ledc test */
    
#ifdef __cplusplus
}
#endif

#endif
